<?php
/**
 * 当前病例对应的用户信息
 */
class DiagnosisUserBase{
	/**
	 * @var string 用户编号
	 */
	public $Id;

	/**
	 * 
	 * @var string 病例编号
	 */
	public $DiagnosisId;
	/**
	 * @var string 用户姓名
	 */
	public $Name;

	/**
	 * @var bool 用户性别
	 */
	public $UserSex;

	/**
	 * @var date 用户生日
	 */
	public $BirthDay;

	/**
	 * @var string 用户所属民族
	 */
	public $People;

	/**
	 * @var string 用户邮箱
	 */
	public $Email;

	/**
	 * @var string 用户的手机
	 */
	public $Mobile;

	public function __construct(){
		$var=get_class_vars(__CLASS__);
		foreach(func_get_args() as $o){
			if(is_array($o)){
				foreach($o as $k => $v){
					if($k=='Id'){
						$this->Id=$v;
					}
					if($k=='DiagnosisId'){
						$this->DiagnosisId=$v;
					}
					else if($k=='Name'){
						$this->Name=$v;
					}
					else if($k=='UserSex'){
						$this->UserSex=intval($v)>0?true:false;
					}
					else if($k=='BirthDay'){
						$this->BirthDay=intval($v);
					}
					else if($k=='People'){
						$this->People=$v;
					}
					else if($k=='Email'){
						$this->Email=$v;
					}
					else if($k=='Mobile'){
						$this->Mobile=$v;
					}
				}
			}else if(is_object($o)){
				foreach($var as $k => $v){
					if(isset($o->Id)){
						$this->Id=$o->Id;
					}
					if(isset($o->DiagnosisId)){
						$this->DiagnosisId=$o->DiagnosisId;
					}
					if(isset($o->Name)){
						$this->Name=$o->Name;
					}
					if(isset($o->UserSex)){
						$this->UserSex=$o->UserSex;
					}
					if(isset($o->BirthDay)){
						$this->BirthDay=$o->BirthDay;
					}
					if(isset($o->People)){
						$this->People=$o->People;
					}
					if(isset($o->Email)){
						$this->Email=$o->Email;
					}
					if(isset($o->Mobile)){
						$this->Mobile=$o->Mobile;
					}
				}
			}
		}
	}

	public function __modetoarray(){
		$var=array();
		foreach(get_class_vars(__CLASS__) as $k => $v){
			$var[$k]=$this->$k;
		}
		return $var;
	}
}
?>